import { Entity, PrimaryGeneratedColumn, Column, ManyToOne } from 'typeorm';
import { AnyStudent } from './any.student.entity';
import { AnyCourse } from './any.course.entity';

@Entity()
export class StudentCourse {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  studentId: number;

  @Column()
  courseId: number; 

  @ManyToOne(() => AnyStudent, student => student.courses)
  student: AnyStudent;

  @ManyToOne(() => AnyCourse, course => course.students)
  course: AnyCourse;
}